package com.xxxy.dongyexuan.mapper;

import com.xxxy.dongyexuan.po.Emp;
import com.xxxy.dongyexuan.po.Work;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

@MapperScan("com.xxxy.dongyexuan.demobeautyhaird.mapper")
public interface IWorkMapper {
    @Select("select count(*) from work")
    public int getcount();

    @Select("SELECT * FROM work WHERE wid = #{wid}")
    public Work findById(@Param("wid") int wid);

    @Select("SELECT * FROM work")
    public List<Work> findAll();

    @Insert("INSERT work VALUES (#{wid},#{wimage})")
    public int save(Work work);

    @Update("UPDATE work SET wimage = #{wimage} WHERE wid = #{wid}")
    public int merge(Work work);

    @Delete("DELETE FROM work WHERE wid = #{wid}")
    public int delete(@Param("wid") int wid);
    @Select("select * from work limit #{from},#{pagesize}")
    public List<Work> findByPage(@Param("from") int from, @Param("pagesize") int pagesize);
}
